<?php

namespace app\admin\command;

use app\common\util\Tools;
use think\console\Input;
use think\console\Output;
use think\facade\Log;

class MenuTest extends CommonTest
{

    //再命令窗口中执行“php think interface-MenuTest”
    protected function configure()
    {
        $this->setName('interface-MenuTest')
            ->setDescription('接口测试');
    }

    public function execute(Input $input, Output $output)
    {
        parent::execute($input, $output);

        //Route::any('admin/lineMenu/getPageList', 'admin/menu/getLineMenuList');                                                 // 线路菜单，分页列表
        $data = Tools::curl($this->url . "admin/lineMenu/getPageList", json_encode(["token" => "$this->token"]));
        Log::write("post". var_export($data,true));
        echo $data . "\n\n";

        //Route::any('admin/lineMenu/getDetailsById', 'admin/menu/getLineMenuDetail');                                            // 线路菜单的详细信息
        $data = Tools::curl($this->url . "admin/lineMenu/getDetailsById", json_encode(["token" => "$this->token", "id" => 1]));
        Log::write("post". var_export($data,true));
        echo $data . "\n\n";

        //Route::any('admin/lineMenu/create', 'admin/menu/toAddLineMenu');                                                        // 添加线路菜单
//        $data = Tools::curl($this->url . "admin/lineMenu/create", json_encode(["token" => "$this->token", "title" => "机场接送", "icon" => '', "type" => 1]));
//        Log::write("post". var_export($data,true));
//        echo $data . "\n\n";
    }
}
